package truef.house.domain;

import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import edu.zut.cs.software.base.domain.BaseTreeEntity;
@Table(name="T_SAdress")
@Entity
@NamedQueries({ @NamedQuery(name = "SAdress.getRoot", query = "select g from SAdress g where g.parent is null") })

public class SAdress extends BaseTreeEntity<SAdress>{
	private static final long serialVersionUID = -9010915145350103613L;
	@Column(name = "NAME")
	String name;
	
	@Column(name = "SWAREHOUSE")
	@OneToMany(mappedBy = "sadresses", cascade = CascadeType.REMOVE, fetch = FetchType.EAGER)
	Set<SWarehouse> swarehouses;
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
}
